using UnityEngine;
using UnityEngine.Audio;

namespace Framework
{
    [RequireComponent(typeof(AudioSource))]
    public class AudioPlayer : MonoBehaviour
    {
        public AudioSource AudioSource { get; private set; }
        private void Awake() => AudioSource = GetComponent<AudioSource>();

        public AudioPlayer SetChannel(AudioMixerGroup channel)
        {
            AudioSource.outputAudioMixerGroup = channel;
            return this;
        }
    }
}